package face.pay.web.enterprise.controller.wxInfo;

import face.pay.common.enterprise.service.IWxInfoService;
import face.pay.common.enterprise.service.impl.WxInfoService;
import face.pay.constant.RoleCode;
import face.pay.constant.UserType;
import face.pay.entity.EnterpriseInfo;
import face.pay.entity.UserInfo;
import face.pay.security.annotation.CurrentUser;
import face.pay.security.exception.BaseException;
import face.pay.util.ResultMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: cjj
 * @Date: 2019/9/24
 * @Description:
 */
@Controller
@RequestMapping("/wxInfo")
public class WxInfoController {

    @Autowired
    private IWxInfoService iWxInfoService;

    @RequestMapping("/edit")
    @ResponseBody
    public ResultMessage edit(@CurrentUser UserInfo loginUser, EnterpriseInfo enterpriseInfo) throws BaseException {
        enterpriseInfo.setUpdatedBy(loginUser.getId());
        return  iWxInfoService.editWxInfo(enterpriseInfo);
    }
}
